<ng-container body-head>
  <div class="profile-body">
    <div class="title">
      <span>系统配置</span>
      <div>
        <button *ngIf="repoForm.untouched" class="btn btn-sm btn-outline-dark" (click)="sync()">
          立即同步
        </button>
        <ng-container *ngIf="repoForm.touched">
          <button mat-icon-button form="form">
            <mat-icon>check_circle</mat-icon>
          </button>
          <button mat-icon-button (click)="reset()">
            <mat-icon>highlight_off</mat-icon>
          </button>
        </ng-container>
      </div>
    </div>
    <form id="form" [formGroup]="repoForm" (ngSubmit)="submit()">
      <div class="row">
        <div>平台源地址：</div>
        <div class="column">
          <input
            class="form-control w35"
            placeholder="服务器源地址, 比如 https://mirrors.ustc.edu.cn/debian"
            formControlName="uri"
          />
        </div>
      </div>

      <div class="row">
        <div>版本：</div>
        <div>
          <input class="form-control" formControlName="distribution" />
        </div>
      </div>

      <div class="row">
        <div>源码：</div>
        <m-switch-checkbox formControlName="enable_source">
          启用源码
        </m-switch-checkbox>
      </div>
    </form>
    <div class="row">
      <div>预览：</div>
      <m-iptable-edit class="w35" [ngModel]="context$ | async" [readonly]="true"></m-iptable-edit>
    </div>
  </div>
</ng-container>
